home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / MSG Wipes / Wipes ƒ / Spiral wipe.c < prev    next >
Text File  |  1994-04-15  |  3KB  |  56 lines

  1. IZE;
  2.         source.bottom=source.top+BOXSIZE;
  3.         source.left=itercol*BOXSIZE;
  4.         source.right=source.left+BOXSIZE;
  5.         OffsetRect(&source, boundsRect.left, boundsRect.top);
  6.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  7.             &source, &source, 0, boundsRgn);
  8.         switch (direction)
  9.         {
  10.             case 0:  /* facing right */
  11.                 if (itercol==sright)
  12.                 {
  13.                     sbottom--;
  14.                     direction++;
  15.                     iterrow--;
  16.                 }
  17.                 else itercol++;
  18.                 break;
  19.             case 1:  /* facing up */
  20.                 if (iterrow==stop)   /* that reads "s top," not "stop" */
  21.                 {
  22.                     sright--;
  23.                     direction++;
  24.                     itercol--;
  25.                 }
  26.                 else iterrow--;
  27.                 break;
  28.             case 2:  /* facing left */
  29.                 if (itercol==sleft)
  30.                 {
  31.                     stop++;
  32.                     direction++;
  33.                     iterrow++;
  34.                 }
  35.                 else itercol--;
  36.                 break;
  37.             case 3:  /* facing down */
  38.                 if (iterrow==sbottom)
  39.                 {
  40.                     sleft++;
  41.                     direction=0;
  42.                     itercol++;
  43.                 }
  44.                 else iterrow++;
  45.                 break;
  46.         }
  47.         if (everyOther)
  48.             TimeCorrection(CorrectTime);
  49.         everyOther=!everyOther;
  50.     }
  51.     
  52.     DisposeRgn(boundsRgn);
  53.     
  54.     return 0;
  55. }
  56.